package com.edu.publisher.mapper;

import com.edu.publisher.beans.AppVideoVisit;
import com.edu.publisher.beans.TrafficKeywords;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AppVideoMapper {


    @Select("select \n" +
            "  chapter_name chapterName,\n" +
            "  count(distinct(user_id)) peoCount,\n" +
            "  sum(time_sum) duringTime,\n" +
            "  sum(time_sum)/peoCount avPeoTime\n" +
            "  from dws_appVideo_view_window\n" +
            "  where toYYYYMMDD(stt) = #{date}\n" +
            "  group by toYYYYMMDD(stt), chapterName\n" +
            "  limit 10")
    List<AppVideoVisit> selectVisitor(@Param(value = "date") Integer date);
}
